<template>
  <el-form label-width="80px">
    <template v-if="typeof(logis) == 'object'">
      <el-form-item label="快递公司" prop="company">
        <span>{{ logis.com }}</span>
      </el-form-item>
      <el-form-item label="快递单号" prop="company">
        <span>{{ logis.num }}</span>
      </el-form-item>
      <ul class="prog">
        <li v-for="(item, index) of logis.logisArr" :key="index">
          <div class="time">
            <h3>{{ item.day }}</h3>
            <h5>{{ item.time }}</h5>
          </div>
          <div class="msg">
            <h5>{{ item.context }}</h5>
          </div>
        </li>
      </ul>
    </template>
    <template v-else>
      <div class="logistics-msg">
        <p style="margin: 0;">快递信息{{ logis }}</p>
      </div>
    </template>
    
  </el-form>
</template>

<script>
  export default {
    name: 'Logistics',
    props: ['logis']
  }
</script>

<style lang="scss" scoped>
  .logistics-msg {
    text-align: center;
  }
  .el-form-item {
    margin-bottom: 0;
  }
  .prog {
    margin-top: 20px;
    padding: 0;
    background: #fff;
    li {
      display: flex;
      padding: 10px;
      .time {
        flex: 0 0 40px;
        margin-right: 40px;
        text-align: right;
        h3 {
          margin: 4px 0;
          font-size: 14px;
          line-height: 18px;
        }
        h5 {
          margin: 4px 0;
          font-size: 12px;
          line-height: 16px;
        }
      }
      .msg {
        flex: 1;
        h3 {
          margin: 4px 0;
          font-size: 14px;
          line-height: 18px;
        }
        h5 {
          margin: 4px 0;
          font-size: 12px;
          line-height: 16px;
        }
      }
    }
  }
</style>
